<!DOCTYPE html>
<html lang="cs">
	<head>
		<meta charset="utf-8" />
		<title>Příklad 6-1</title>
		<meta name="author" content="Daniel Bielczyk" />
    
    <script src="libs/scanvas.js"></script>
    
	</head>
	<body style="margin: 0; padding: 0;">
		
    <div id="canvas">
		  <canvas width="400" height="400"></canvas>
    </div>
    
<script>

new sCanvas("canvas", function() {

var attrs = {
  x: 40,
  y: 40,
  width: 30,
  height: 30,
  fill: null,
  stroke: "black",
  lineWidth: 2,
  rotation: Math.PI / 4 //rotace o 45 stupňů
};

var r1 = this.rect(attrs);
this.circ(r1.attr("x"), r1.attr("y"), 3).attr("fill", "red");

var r2 = this.rect(attrs).attr({
  x: 100,
  originX: -15,
  originY: -15
});
this.circ(r2.attr("x"), r2.attr("y"), 3).attr("fill", "red");

var r3 = this.rect(attrs).attr({
  originX: -15,
  originY: -15,
  x: 100,
  stroke: "blue"
});
this.circ(r3.attr("x"), r3.attr("y"), 3).attr("fill", "red");

});

</script>
		
	</body>
</html>